// @ts-nocheck
const axios = require('axios');
const {resolve}=require('path');
const env=require(resolve('./config.js'));
const userAgent = env['user_agent'];
const cookie = env['Cookies'];

function reqDetails(url) {
    return new Promise((resolve, reject) => {
        axios.get(url,{
            headers: {
                'User-Agent': userAgent[Math.floor((Math.random() * userAgent.length))],
                'Cookie':cookie
            }
        }).then(
            (response) => {
                resolve(response.data);
            },
            reason => reject(reason)
        )
    })
}

module.exports = { reqDetails }